package br.com.insula.twithis.processor.impl;

import java.io.IOException;

import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;

import br.com.insula.twithis.processor.Payload;
import br.com.insula.twithis.processor.Processor;

public class ImageProcessor implements Processor {

	public Payload getPayload(Object context) {
		String path = (String) context;

		return new ImagePayload(path);
		
//		FileConnection conn = null;
//		try {
//			conn = (FileConnection) Connector.open(path, Connector.READ);
//
//			if (conn != null && conn.exists()) {
//				return new ImagePayload(path);
//			}
//		}
//		catch (IOException e) {
//			e.printStackTrace();
//			return null;
//		}
//		finally {
//			try {
//				if (conn != null)
//					conn.close();
//			}
//			catch (IOException e) {
//			}
//		}
//
//		return null;
	}

}
